
from datetime import datetime

from sqlalchemy import BigInteger, Boolean, Column, DateTime, ForeignKey, Integer, \
    String, Text, UniqueConstraint
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func

from app.common.database import Base
from app.models.base import TableBase, TableBase2

    
  
class PayProduct(TableBase):
    """支付产品表"""
    __tablename__ = "t_pay_product"
    id = Column(Integer, primary_key=True, index=True)
    product_code = Column(String(24), unique=True, index=True, nullable=False, comment='产品编码')
    product_name = Column(String(24), nullable=False,  comment='产品名称')
    pay_type = Column(Integer, nullable=False,  comment='支付类型 微信公众号/小程序/支付宝扫码/代付')
    pay_channel_code = Column(String(24), nullable=False,  comment='通道编码')
    pay_channel_name = Column(String(24), comment='通道名称')
    channel_merc_no = Column(String(24), nullable=False,  comment='上游支付通道商户编号')
    status = Column(Integer, nullable=False, comment='状态 1.正常;2.停用')
    channel_factor_no = Column(String(24), comment='上游支付通道代理编号')
    pay_url = Column(String(32), comment='支付URL')
    encrypt_mode = Column(String(32), nullable=False, comment='加密算法')
    settle_period = Column(String(2), nullable=False, comment='结算周期 T0/T1/D1')

